<template>
  <el-switch
    inline-prompt
    v-model="useGlobal.globalConfig.isDark"
    :active-icon="Sunny"
    :inactive-icon="Moon"
    @change="switchDark"
  />
</template>

<script setup lang="ts">
import { useTheme } from "@/hooks/useTheme";
import { Sunny, Moon } from "@element-plus/icons-vue";
import { useGlobalStore } from "@/stores";

defineOptions({
  name: "SwitchDark"
});

const { switchDark } = useTheme();
const useGlobal = useGlobalStore();
</script>
